/**
 *
 * @author Eric Hushagen
 */

import java.util.logging.Logger;

public class ehPingPongListener extends PluginListener {

    protected static final Logger log = Logger.getLogger("Minecraft");

    public boolean onChat(Player player, String string) {
        if (string.matches("ping")) {
            tellEveryone("<SERVER> PONG");
            log.info("PONG");
        }
        //DO NOT RETURN TRUE OR NO ONE CAN TALK, DUMMY.
        return false;
    }

    public void tellEveryone(String announce) {
        for (Player p : etc.getServer().getPlayerList()) {
            if (p != null) {
                p.sendMessage(Colors.LightPurple + announce);
            }
        }
    }
}
